package com.nandi.deviceinstall.model

import android.util.Log
import com.nandi.deviceinstall.bean.*
import com.nandi.deviceinstall.contract.TapRecordContract
import com.nandi.deviceinstall.net.RetrofitClient
import io.reactivex.Flowable

class TapRecordModel : TapRecordContract.Model {


    private val apiService = RetrofitClient.getInstance()!!.api!!
    override fun executeDeleteTapRecord(token: String, id: Int): Flowable<DeleteBean> {
        return apiService.deleteTapRecord(token,id)
    }

    override fun executeDisNum(token: String, disName: String, areaCode: String): Flowable<DisNumBean> {
        return apiService.getDisNum(token,disName,areaCode)
    }

    override fun getListDisaster(token: String, current: Int, size: Int, areaCode: String): Flowable<DisasterBean> {
        return apiService.listDisaster(token, areaCode)
    }

    override fun getListCity(token: String, district: String): Flowable<CityBean> {
        return apiService.listCity(token, district)
    }

    override fun getListTown(token: String, id: Int): Flowable<TownBean> {
        return apiService.listTown(token, id)
    }

    override fun getListRecord(token: String, current: Int, size: Int, monitorMethod: Int, areaCode: String,
                               sort: Int, townCode: String, disasterName: String, disNo: String,
                               monitorNo: String, startTime: String, endTime: String, isAppAdd: Int):
            Flowable<TapRecordBean> {
        return apiService.listTapRecord(token, current, size, monitorMethod, areaCode, sort, townCode,
                disasterName, disNo, monitorNo, startTime, endTime, isAppAdd)
    }

    override fun executeListDisName(token: String, disasterName: String, town: String): Flowable<DisNameBean> {
        return apiService.listDisName(token, disasterName, town)
    }

    override fun getListMonitorNum(token: String, unifiedCode: String): Flowable<ListMonitorNumBean> {
        return apiService.listMonitorNum(token, unifiedCode)
    }
}
